# 151. 反转字符串中的单词

def reverseWords(s):
    """
    :type s: str
    :rtype: str
    """
    s_arr = s.split(" ")
    s_arr = [temp for temp in s_arr if temp != '']
    return " ".join(s_arr[::-1])
def reverseWords_1(s):
    """
    :type s: str
    :rtype: str
    """
    return " ".join(reversed(s.split()))


s_1 = "the sky is blue"
result = reverseWords_1(s_1)
print(f"result:{result}")

s_2 = "  hello world  "
result = reverseWords_1(s_2)
print(f"result:{result}")

s_3 = "a good   example"
result = reverseWords_1(s_3)
print(f"result:{result}")

print("".split())
